package it.mypofolio.model;

/**
 * @author  Paolo Cappelletti (Gempliss Srl)
 */
public class Stock {

	
	
	private String name;
	private String sigla;
	private int quantity;
	private double buyPrice;
	
	private double buyCommission;
	private double sellCommission;
	
	private double currentPrice;
	private String currentPriceOra;
	
	
	public Stock(String name, String sigla, int quantity, double buyPrice,
			double buyCommission, double sellCommission) {
		super();
		this.name = name;
		this.sigla = sigla;
		this.quantity = quantity;
		this.buyPrice = buyPrice;
		this.buyCommission = buyCommission;
		this.sellCommission = sellCommission;
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getSigla() {
		return sigla;
	}
	public void setSigla(String sigla) {
		this.sigla = sigla;
	}
	public int getQuantity() {
		return quantity;
	}
	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}
	public double getBuyPrice() {
		return buyPrice;
	}
	public void setBuyPrice(double buyPrice) {
		this.buyPrice = buyPrice;
	}
	public double getBuyCommission() {
		return buyCommission;
	}
	public void setBuyCommission(double buyCommission) {
		this.buyCommission = buyCommission;
	}
	
	
	
	
	public double getCurrentPrice() {
		return currentPrice;
	}

	public void setCurrentPrice(double currentPrice) {
		this.currentPrice = currentPrice;
	}

	public String getCurrentPriceOra() {
		return currentPriceOra;
	}

	public void setCurrentPriceOra(String currentPriceOra) {
		this.currentPriceOra = currentPriceOra;
	}

	public String toString(){
		String ret=name+ " ["+sigla+"]\n";
		ret=ret+ " Quantity: "+quantity+"\n";
		ret=ret+ "   buy price    : "+buyPrice+"\n";
		ret=ret+ "   current price: "+currentPrice+" ["+currentPriceOra+"]\n";		
		ret=ret+ "   SALDO        : "+((currentPrice*quantity)-(buyPrice*quantity))+"\n";
		return ret;
	}

	public double getSellCommission() {
		return sellCommission;
	}

	public void setSellCommission(double sellCommission) {
		this.sellCommission = sellCommission;
	}

}
